
#pragma once

#include <IVideoDriver.h>
using namespace irr;
using namespace video;

#include "Color.h"
#include "Fog.h"
#include "ImageLoader.h"

namespace Irrlicht
{
	namespace Net
	{
		namespace Video
		{
			public ref class VideoDriver : public ReferenceCounted
			{
			internal:
				IVideoDriver* insider;

			public:
				VideoDriver(IVideoDriver* ivd)
				{
					insider = ivd;
				}

				bool BeginScene(bool backBuffer, bool zBuffer, Color^ color)
				{
					return insider->beginScene(backBuffer, zBuffer, *color->insider);
				}
				bool EndScene()
				{
					return insider->endScene();
				}


				bool CheckDriverReset()
				{
					return insider->checkDriverReset();
				}


				property unsigned int ImageLoaderCount
				{
					unsigned int get()
					{
						return insider->getImageLoaderCount();
					}
				}
				Video::ImageLoader^ GetImageLoader(unsigned int n)
				{
					return gcnew Video::ImageLoader(insider->getImageLoader(n));
				}
				property unsigned int ImageWriterCount
				{
					unsigned int get()
					{
						return insider->getImageWriterCount();
					}
				}


				property unsigned int TextureCount
				{
					unsigned int get()
					{
						return insider->getTextureCount();
					}
				}


				void RemoveAllTextures()
				{
					insider->removeAllTextures();
				}


				void RemoveAllHardwareBuffers()
				{
					insider->removeAllHardwareBuffers();
				}

				void SetFog(Color^ color, FogType type, float start, float end, float density, bool pixel, bool range)
				{
					insider->setFog(*color->insider, (E_FOG_TYPE)type, start, end, density, pixel, range);
				}
			};
		}
	}
}